package com.hundredapp.oa.repository;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.hundredapp.oa.dao.GenericDao;
import com.hundredapp.oa.domain.OaMakeup;

@Repository
public class MakeupManagerImpl implements MakeupManager {

	@Autowired
	private GenericDao<OaMakeup, Integer> makeupDao;
	
	@Override
	public int add(OaMakeup makeup) {
		return makeupDao.save(makeup);
	}

	@Override
	public List<OaMakeup> findAllMakeup(String condition, int start, int limit) {
		return makeupDao.find(condition, start, limit);
	}

	@Override
	public OaMakeup findMakeupById(int id) {
		return makeupDao.findById(id);
	}

	@Override
	public void delete(int id) {
		makeupDao.remove(makeupDao.findById(id));
	}

	@Override
	public void update(OaMakeup makeup) {
		makeupDao.modify(makeup);
	}

	@Override
	public int count(String condition) {
		return makeupDao.count(condition);
	}

	@Override
	public List<OaMakeup> findAll(String condition) {
		return makeupDao.find(condition);
	}

}
